package be.kdg.netpresentadmin;

import java.awt.*;
import java.awt.event.*;

import javax.swing.*;

import be.kdg.netpresent.*;

public class AdminGUI extends JFrame implements ActionListener {

	// Default serial ID
	private static final long serialVersionUID = 1L;
	
	// All attributes needed to create the GUI as intended. These
	// represent the common parts of AdminRun- & AdminMakePresentation.
	protected JButton jbInst0;
	protected ImagePanel imagePanel;
	protected InfoPanel infoPanel;
	protected Container content;
	
	// Interface to the presentation to be shown/used.
	protected PresentationInt presentation;
	
	// Time stamp for synchronization purposes.
	protected long lUptodate;

	// Constructor creating the GUI elements and aligning them appropriate.
	public AdminGUI() {
		this.initialisePanels();
		setLocation(20, 20);
		setSize(1040, 806);
		setMinimumSize(new Dimension(1040, 806));
		
		// This setting is important/needed to be able to keep the application
		// running when switching between GUI's. EXIT_ON_CLOSE would invoke
		// a system.exit(1); which ends everything. 
		setDefaultCloseOperation(DISPOSE_ON_CLOSE);
		setTitle("NetPresent - Admin");
	}

	// Method for aligning and presetting all GUI attributes.
	public void initialisePanels() {
		content = getContentPane();
		content.setLayout(null);

		imagePanel = new ImagePanel();
		imagePanel.setBounds(10, 10, 800, 600);
		content.add(imagePanel);

		infoPanel = new InfoPanel(Color.lightGray, new Dimension(790, 128));
		infoPanel.setBackground(Color.lightGray);
		infoPanel.setBounds(10, 620, 800, 105);
		content.add(infoPanel);

		jbInst0 = new JButton(
				"Klik hier om naar de volgende slide over te gaan");
		jbInst0.setBounds(10, 730, 800, 25);
		jbInst0.addActionListener(this);
		content.add(jbInst0);

	}

	// Additional method to be able to change the button text, used to
	// create a more user friendly GUI and solve ambiguous interpretation.
	public void updateButtonText(String sNewCaption) {
		this.jbInst0.setText(sNewCaption);
	}

	// Method for the button listener.
	@Override
	public void actionPerformed(ActionEvent arg0) {
		// TODO Auto-generated method stub

	}
}
